package advice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import vo.ResponseData;

/**
 * @program: sporadic
 * @description:
 * @author: LHD   QQ:1727865856
 * @create: 2019-10-15 14:22
 **/
@ControllerAdvice
public class AdviceException {

    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public ResponseData<Void> RuntimeExceptionHandler(RuntimeException ex) {
        return new ResponseData<Void>(null, ex.getMessage());
    }
}
